/*
 $Id: chtbl.h,v 1.4 2005/05/20 19:13:48 olivier Exp $
 +----------------------------------------------------------------------+
 | Copyright : mFactories 2001, 2005 
 +----------------------------------------------------------------------+
 | Projet : DataStructure
 +----------------------------------------------------------------------+
 | $Source: /cvs/DataStructure/DataStructureLib/include/chtbl.h,v $
 | $Author: olivier $
 | $Date: 2005/05/20 19:13:48 $
 | $Revision: 1.4 $ 
 +----------------------------------------------------------------------+
 | Description :                                              
                               
 +----------------------------------------------------------------------+
 | Historique :
 $Log: chtbl.h,v $
 Revision 1.4  2005/05/20 19:13:48  olivier
 Formattage pour gcc

 Revision 1.3  2005/02/11 22:35:11  olivier
 Ajout des exportations C++

 Revision 1.2  2005/01/14 19:20:18  olivier
 Update
 
 +----------------------------------------------------------------------+
*/
#ifndef CHTBL_H
#define CHTBL_H

#include <list.h>

typedef struct 
{
  int		conteneurs;
  int		(*h)( const pointer_t cle );
  int		(*corresp)( const pointer_t cle1, const pointer_t cle2 );
  void		(*destroy)( pointer_t data );
  int		size;
  plist_t	table;
} CHTbl;

#define chtbl_size( htab ) ( (htab)->size )

#ifdef __cplusplus
	extern "C" {
#endif /* __cplusplus */

int		chtbl_init( CHTbl * htab, int conteneurs, int (*h)( const pointer_tcle ), int (*corresp)( const pointer_t cle1, const pointer_t cle2 ), void (*destroy)( pointer_t data ) );
int		chtbl_destroy( CHTbl * htab );
int		chtbl_insert( CHTbl * htab, const pointer_t data );
int		chtbl_remove( CHTbl * htab, ppointer_t data );
int		chtbl_lookup( const CHTbl * htab, ppointer_t data );

#ifdef __cplusplus
	}
#endif /* __cplusplus */

#endif /* CHTBL_H */
